\(\int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx\) [28]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 39 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2 \arctan \left (\frac {a+2 b x}{\sqrt {3} a}\right )}{\sqrt {3} b}-\frac {\log (a-b x)}{b} \]

[Out]

-ln(-b*x+a)/b+2/3*arctan(1/3*(2*b*x+a)/a*3^(1/2))/b*3^(1/2)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {1882, 31, 631, 210} \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2 \arctan \left (\frac {a+2 b x}{\sqrt {3} a}\right )}{\sqrt {3} b}-\frac {\log (a-b x)}{b} \]

[In]

Int[(2*a^2 + b^2*x^2)/(a^3 - b^3*x^3),x]

[Out]

(2*ArcTan[(a + 2*b*x)/(Sqrt[3]*a)])/(Sqrt[3]*b) - Log[a - b*x]/b

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 631

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[a*(c/b^2)]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b)], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 1882

Int[(P2_)/((a_) + (b_.)*(x_)^3), x_Symbol] :> With[{A = Coeff[P2, x, 0], B = Coeff[P2, x, 1], C = Coeff[P2, x,
 2]}, With[{q = Rt[a/b, 3]}, Dist[C/b, Int[1/(q + x), x], x] + Dist[(B + C*q)/b, Int[1/(q^2 - q*x + x^2), x],
x]] /; EqQ[A - Rt[a/b, 3]*B - 2*Rt[a/b, 3]^2*C, 0]] /; FreeQ[{a, b}, x] && PolyQ[P2, x, 2]

Rubi steps \begin{align*} \text {integral}& = \frac {a \int \frac {1}{\frac {a^2}{b^2}+\frac {a x}{b}+x^2} \, dx}{b^2}-\frac {\int \frac {1}{-\frac {a}{b}+x} \, dx}{b} \\ & = -\frac {\log (a-b x)}{b}-\frac {2 \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,1+\frac {2 b x}{a}\right )}{b} \\ & = \frac {2 \tan ^{-1}\left (\frac {a+2 b x}{\sqrt {3} a}\right )}{\sqrt {3} b}-\frac {\log (a-b x)}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.82 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2 \sqrt {3} \arctan \left (\frac {a+2 b x}{\sqrt {3} a}\right )-2 \log (a-b x)+\log \left (a^2+a b x+b^2 x^2\right )-\log \left (a^3-b^3 x^3\right )}{3 b} \]

[In]

Integrate[(2*a^2 + b^2*x^2)/(a^3 - b^3*x^3),x]

[Out]

(2*Sqrt[3]*ArcTan[(a + 2*b*x)/(Sqrt[3]*a)] - 2*Log[a - b*x] + Log[a^2 + a*b*x + b^2*x^2] - Log[a^3 - b^3*x^3])
/(3*b)

Maple [A] (verified)

Time = 1.51 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.97

method result size
risch \(\frac {2 \arctan \left (\frac {\left (2 b x +a \right ) \sqrt {3}}{3 a}\right ) \sqrt {3}}{3 b}-\frac {\ln \left (b x -a \right )}{b}\) \(38\)
default \(-\frac {\ln \left (-b x +a \right )}{b}+\frac {2 \sqrt {3}\, \arctan \left (\frac {\left (2 b^{2} x +a b \right ) \sqrt {3}}{3 a b}\right )}{3 b}\) \(44\)

[In]

int((b^2*x^2+2*a^2)/(-b^3*x^3+a^3),x,method=_RETURNVERBOSE)

[Out]

2/3*arctan(1/3*(2*b*x+a)/a*3^(1/2))/b*3^(1/2)-1/b*ln(b*x-a)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.92 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2 \, \sqrt {3} \arctan \left (\frac {\sqrt {3} {\left (2 \, b x + a\right )}}{3 \, a}\right ) - 3 \, \log \left (b x - a\right )}{3 \, b} \]

[In]

integrate((b^2*x^2+2*a^2)/(-b^3*x^3+a^3),x, algorithm="fricas")

[Out]

1/3*(2*sqrt(3)*arctan(1/3*sqrt(3)*(2*b*x + a)/a) - 3*log(b*x - a))/b

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.15 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.54 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=- \frac {\frac {\sqrt {3} i \log {\left (x + \frac {a - \sqrt {3} i a}{2 b} \right )}}{3} - \frac {\sqrt {3} i \log {\left (x + \frac {a + \sqrt {3} i a}{2 b} \right )}}{3} + \log {\left (- \frac {a}{b} + x \right )}}{b} \]

[In]

integrate((b**2*x**2+2*a**2)/(-b**3*x**3+a**3),x)

[Out]

-(sqrt(3)*I*log(x + (a - sqrt(3)*I*a)/(2*b))/3 - sqrt(3)*I*log(x + (a + sqrt(3)*I*a)/(2*b))/3 + log(-a/b + x))
/b

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.13 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2 \, \sqrt {3} \arctan \left (\frac {\sqrt {3} {\left (2 \, b^{2} x + a b\right )}}{3 \, a b}\right )}{3 \, b} - \frac {\log \left (b x - a\right )}{b} \]

[In]

integrate((b^2*x^2+2*a^2)/(-b^3*x^3+a^3),x, algorithm="maxima")

[Out]

2/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*b^2*x + a*b)/(a*b))/b - log(b*x - a)/b

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.97 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2 \, \sqrt {3} \arctan \left (\frac {\sqrt {3} {\left (2 \, b x + a\right )}}{3 \, a}\right )}{3 \, b} - \frac {\log \left ({\left | b x - a \right |}\right )}{b} \]

[In]

integrate((b^2*x^2+2*a^2)/(-b^3*x^3+a^3),x, algorithm="giac")

[Out]

2/3*sqrt(3)*arctan(1/3*sqrt(3)*(2*b*x + a)/a)/b - log(abs(b*x - a))/b

Mupad [B] (verification not implemented)

Time = 9.03 (sec) , antiderivative size = 86, normalized size of antiderivative = 2.21 \[ \int \frac {2 a^2+b^2 x^2}{a^3-b^3 x^3} \, dx=\frac {2\,\sqrt {3}\,\mathrm {atan}\left (\frac {4\,\sqrt {3}\,a^3\,b^4}{4\,a^3\,b^4-4\,a^2\,b^5\,x}+\frac {4\,\sqrt {3}\,a^2\,b^5\,x}{4\,a^3\,b^4-4\,a^2\,b^5\,x}\right )}{3\,b}-\frac {\ln \left (a-b\,x\right )}{b} \]

[In]

int((2*a^2 + b^2*x^2)/(a^3 - b^3*x^3),x)

[Out]

(2*3^(1/2)*atan((4*3^(1/2)*a^3*b^4)/(4*a^3*b^4 - 4*a^2*b^5*x) + (4*3^(1/2)*a^2*b^5*x)/(4*a^3*b^4 - 4*a^2*b^5*x
)))/(3*b) - log(a - b*x)/b